package cn.lh.web.controller;

import cn.lh.result.JSONResult;
import cn.lh.service.IVerifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/verifycode")
public class VerifyCodeController {
    @Autowired
    IVerifyService verifyService;

    @GetMapping("/imageCode/{key}")
    private JSONResult imageVerifyCode(@PathVariable("key") String key) {
        String imageVerifyCode = verifyService.getImgCode(key);
        return JSONResult.success(imageVerifyCode);
    }
}
